USE [TP_AI_Telefonia]
GO

/****** Object:  Table [dbo].[Consumos]    Script Date: 11/7/2012 9:44:44 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Consumos](
	[ConsumoId] [int] IDENTITY(1,1) NOT NULL,
	[Fecha] [datetime] NOT NULL,
	[ServicioId] [int] NOT NULL,
	[Cantidad] [int] NOT NULL,
	[LineaId] [int] NOT NULL,
	[Estado] [varchar](50) NOT NULL,
 CONSTRAINT [PK_Consumos] PRIMARY KEY CLUSTERED 
(
	[ConsumoId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[Consumos]  WITH CHECK ADD  CONSTRAINT [FK_Consumos_Lineas] FOREIGN KEY([LineaId])
REFERENCES [dbo].[Lineas] ([LineaId])
GO

ALTER TABLE [dbo].[Consumos] CHECK CONSTRAINT [FK_Consumos_Lineas]
GO

ALTER TABLE [dbo].[Consumos]  WITH CHECK ADD  CONSTRAINT [FK_Consumos_Servicios] FOREIGN KEY([ServicioId])
REFERENCES [dbo].[Servicios] ([ServicioId])
GO

ALTER TABLE [dbo].[Consumos] CHECK CONSTRAINT [FK_Consumos_Servicios]
GO

